package com.yuantu.judiciary.controller;

import com.yuantu.judiciary.common.Response;
import com.yuantu.judiciary.common.ResponseFactory;
import com.yuantu.judiciary.model.form.EncryptParamForm;
import com.yuantu.judiciary.service.ISysOpenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统对外开放接口
 *
 * @author syw
 * @since 2024-01-08
 **/
@RestController
@RequestMapping(value = "/external")
@Api(tags = "系统对外开放接口")
@RequiredArgsConstructor
public class SysOpenController {

    private final ISysOpenService openService;

    @ApiOperation(value = "获取查询个人结果")
    @PostMapping("/get/query-person-results")
    public Response<String> getQueryPersonResults(@RequestBody @Validated EncryptParamForm form) {
        return ResponseFactory.okResponse(openService.getQueryPersonResults(form));
    }

    @ApiOperation(value = "获取查询企业结果")
    @PostMapping("/get/query-enterprise-results")
    public Response<String> getQueryEnterpriseResults(@RequestBody @Validated EncryptParamForm form) {
        return ResponseFactory.okResponse(openService.getQueryEnterpriseResults(form));
    }

}
